#pragma once

#include <thread>
#include <iostream>
#include <memory>

struct func
{
public:
	int a = 0;
	void do_some_work() { std::cout << a << "\n"; };
};

void do_background_work(std::unique_ptr<func> s)
{
	std::cout << s->a << "\n";
	(s->a)++;
}

void part_2_2()
{
	std::unique_ptr<func> b(new func);
	std::thread t(do_background_work, std::move(b));
	t.join();
}